import datetime
from python_baway.common.xcommon import sep

sep('datetime, ordinal and weekday')


def xcheck_ordinal(xdt):
    xordinal = xdt.toordinal()
    print(f'Ordinal: {xordinal:,d}, Day: {xordinal % 7}')


xnowdt = datetime.datetime.now()
xcheck_ordinal(xnowdt)
xcheck_ordinal(datetime.date(1, 1, 1))
print(f'Today is weekday {xnowdt.weekday()}, iso weekday {xnowdt.isoweekday()}')
